﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Sisocana.Core.Models.VideoAsociadoModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Site Configuration
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="HeaderContent" runat="server">
    <%--para el menu para el menu--%>
    	
    <link href="<%: Url.Content("~/Content/tabbedContent.css") %>" rel="stylesheet" type="text/css" />
	<script src="<%: Url.Content("~/Scripts/tabbedContent.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/jquery-ui-1.8.11.js") %>" type="text/javascript"></script>
    <link href="<%: Url.Content("~/Content/themes/base/jquery.ui.all.css") %>" rel="stylesheet" type="text/css" />

    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $("p a, input:submit,input:file ").button();
        });
    </script>
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

<% Html.EnableClientValidation(); %>

<% using (Html.BeginForm()) { %>
    <%: Html.ValidationSummary(true) %>
    <h2>Site Configuration</h2>
    <fieldset>
    <% Html.RenderPartial("MenuEditSite", Model.idSitio); %>
        <%:Html.HiddenFor(model => model.idSitio) %>
        <%:Html.HiddenFor(model => model.id) %>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.VideoAsociadoName) %>
        </div>
        <div class="editor-field">
            <% = Html.DropDownList("VideoAsociadoName")%>         
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.tagBusqueda) %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.tagBusqueda) %>
            <%: Html.ValidationMessageFor(model => model.tagBusqueda) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.apiKey) %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.apiKey)%>
            <%: Html.ValidationMessageFor(model => model.apiKey)%>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.tipo) %>
        </div>
        <div class="editor-field">
            <% = Html.DropDownList("tipo")%>         
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.cantVisualizar) %>
        </div>
        <div class="editor-field">
            <% = Html.DropDownList("cantVisualizar")%>         
        </div>
        <div id="1">
            <div class="editor-label">
                <%: Html.LabelFor(model => model.width) %>
            </div>
            <div class="editor-field">
                <%: Html.EditorFor(model => model.width)%>
                <%: Html.ValidationMessageFor(model => model.width)%>
            </div>
            <div class="editor-label">
                <%: Html.LabelFor(model => model.heigth) %>
            </div>
            <div class="editor-field">
                <%: Html.EditorFor(model => model.heigth)%>
                <%: Html.ValidationMessageFor(model => model.heigth)%>
            </div>
        </div>
	    <script>
	        $('#tipo').change(function () {
	            if ($('#tipo').val() == "Small") {
	                $('#1').hide();
	                while ($('#cantVisualizar').find('option').size() > 0)
	                    $('#cantVisualizar').find('option').remove();
	                $('#cantVisualizar').append('<option value=4>4</option>');
	                $('#cantVisualizar').append('<option value=8>8</option>');
	            }
	            else {
	                $('#1').show();
	                while ($('#cantVisualizar').find('option').size() > 0)
	                    $('#cantVisualizar').find('option').remove();
	                $('#cantVisualizar').append('<option value=1>1</option>');
	                $('#cantVisualizar').append('<option value=2>2</option>');
	                $('#cantVisualizar').append('<option value=3>3</option>');
	                $('#cantVisualizar').append('<option value=4>4</option>');
	                $('#cantVisualizar').append('<option value=5>5</option>');
	                $('#cantVisualizar').append('<option value=6>6</option>');
	                $('#cantVisualizar').append('<option value=7>7</option>');
	                $('#cantVisualizar').append('<option value=8>8</option>');
	                $('#cantVisualizar').append('<option value=9>9</option>');
	                $('#cantVisualizar').append('<option value=10>10</option>');
	            }
	        });
	        $(document).ready(function () {
	            if ($('#tipo').val() == "Small") {
	                $('#1').hide();
	            }
	            else
	                $('#1').show();
	        });
        </script>
        <p>
            <% if (Model.tagBusqueda == null || Model.tagBusqueda.Equals(""))
               {%>
                <input type="submit" value="Create" />
             <%}
               else
               {%>
                <input type="submit" value="Update" />
            <% } %>
        </p>
    </fieldset>
<% } %>

<div>
    <%: Html.ActionLink("Back to List", "Index") %>
</div>

</asp:Content>

